<?php

/**
 * Source code under Creative Commons License 
 * (see LICENSE FILE)
 *
 * Copyright (c) 2013 Maelstrom.
 * All rights reserved.
 *
 *
 * @author      Maelstrom <devcreamframework@gmail.com>
 * @copyright   2012 Maelstrom.
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 * @link        https://github.com/maelstromkd/cream-dev.git
 * @version     1.2
 */

require realpath(dirname(__FILE__)) . '/../../core/paths.php';
require __CORE__ . 'core.php';

$_APP = new Backend();
$_APP->setCache(false);


if($_APP->check('post','id')){

	$getId 	= explode('-',$_POST['id']);
	$id 	= $getId[1];

	switch ($_GET['t']) {
		case 'legends':
			$data 	= array('id' => $id, 'legend' => $_POST['value']);
			$_APP->_ARTIST->updateLegend($data);
			echo $_POST['value'];
		break;

		case 'dates':
			$data 	= array('id' => $id, 'date' => $_POST['value']);
			$_APP->_ARTIST->updateDate($data);
			echo $_POST['value'];
		break;
	}
}
